<?php

namespace Admin\Controller;

class LoginController extends \Think\Controller
{

    public function login($username = NULL, $password = NULL)
    {
        $admin = M('Admin')->where(array(
            'username' => $username
        ))->find();

        if ($admin['password'] != md5($password)) {
            $this->ajaxError('用户名或密码错误！');
        } else {
            $this->ajaxSuccess('登陆成功!');
        }
    }
}

?>